package com.test.server.impl;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.common.json.JSON;
import com.alibaba.dubbo.config.annotation.Service;
import com.test.api.IUserService;
import com.test.entity.UserBean;
import com.test.server.dao.UserMapper;

@Service
public class UserServiceImpl implements IUserService {

	private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
	
	    @Autowired  
	    private UserMapper userMapper;  
	    @Override
	    public int insert(UserBean record){  
	        return userMapper.insert(record);  
	    }  
	    @Override
	      public int insertSelective(UserBean record){  
	        return userMapper.insertSelective(record);  
	    }  
	    //需要自己定义Mapper文件中的方法  
	    @Override
	    public List<UserBean> getUsers() {  
	        logger.info("开始查询所有用户信息");  
	          
	        logger.info("查询结束");  
	        return userMapper.selectAll();  
	    }  
	    @Override
	    public int deleteByPrimaryKey(Integer id) {  
	        return userMapper.deleteByPrimaryKey(id);  
	    }  
	    @Override
	    public UserBean selectByPrimaryKey(Integer id) {  
	        return userMapper.selectByPrimaryKey(id);  
	    }  
	    @Override
	    public int updateByPrimaryKeySelective(UserBean record) {  
	        return userMapper.updateByPrimaryKeySelective(record);  
	    }  
	    @Override
	    public int updateByPrimaryKey(UserBean record) {  
	        return userMapper.updateByPrimaryKey(record);  
	    }

		@Override
		public List<UserBean> selectAll() {
			return userMapper.selectAll();
		}  
		

}
